

% ************************************************************************ 
%     Module name   : Fusion Simulation - scheduleTargets                                                     
%                                                                          
%     Description   : This will schedule the sequence of when the radars will simultaniously intercept the targets in the scene.                                                    
%                                                                          
%     $Header: /Lynx/SimulationFramework/RSP/IFS/IFSRun.m 2     15/10/08 16:08 Lwabeke $ 
%                                                                          
%    $Author: Lwabeke $	            
%                                                                         
%    $Revision: 2 $                
%                                                                         
% ************************************************************************
%     $History: IFSRun.m $ 
% 
%
% ************************************************************************

function [ActiveTargetSequence, scheduleState] = scheduleTargets_Run(currentTime, scheduleState, TargetSequence, param)

% Should define a subset of the TargetSequence to give a consistent
% schedule
%ActiveTargetSequence = TargetSequence.radar(1).TargetSequence(:, 1);
[scheduleState.PQ, scheduleState.status, ActiveTargetSequence] = ...
  BsMf_Schedule(scheduleState.PQ, TargetSequence.radar(1).TargetSequence,...
  TargetSequence.radar(2).TargetSequence, param);

if (~scheduleState.status) || (size(ActiveTargetSequence, 1) < 1)
  % it failed what to do?
  ActiveTargetSequence = [];
end
  